翻訳と辞書
Words near each other
・ Everblue 2
・ Everbread
・ Everbridge
・ Everbright
・ Everbright Securities
・ Evercam
・ Everclear
・ Everclear (album)
・ Everclear (alcohol)
・ Everclear (band)
・ Everclear discography
・ Evercookie
・ Evercore Partners
・ Evercore Wealth Management
・ Evenwood, West Virginia
Even–odd rule
・ Even–Paz protocol
・ EveR
・ Ever
・ Ever (artist)
・ Ever (fragrance)
・ Ever (IQ album)
・ Ever (Love Spirals Downwards album)
・ Ever (song)
・ Ever After
・ Ever After (disambiguation)
・ Ever After (Fayray album)
・ Ever After (Marianas Trench album)
・ Ever After (The Mission album)
・ Ever After (The Three O'Clock album)


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Even–odd rule : ウィキペディア英語版
Even–odd rule
The even–odd rule is an algorithm implemented in vector-based graphic software,〔J. D. Foley, A. van Dam, S. K. Feiner, and J. F. Hughes. Computer Graphics: Principles and Practice. The Systems
Programming Series. Addison-Wesley, Reading, 2nd edition, 1990.〕 like the PostScript language and Scalable Vector Graphics (SVG), which determines how a graphical shape with more than one closed outline will be filled. Unlike the nonzero-rule algorithm, this algorithm will alternatively color and leave uncolored shapes defined by nested closed paths irrespective of their winding.
The SVG specification says: "''This rule determines the "insideness" of a point on the canvas by drawing a ray from that point to infinity in any direction and counting the number of path segments from the given shape that the ray crosses. If this number is odd, the point is inside; if even, the point is outside.''"
The rule can be seen in effect in many vector graphic programs (like Freehand or Illustrator), where a crossing of an outline with itself causes shapes to fill in strange ways.
On a simple curve, the even–odd rule reduces to a decision algorithm for the point in polygon problem.
== Implementation ==
Below is an example implementation in Python:〔http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html〕

# x, y -- x and y coordinates of point
# poly -- a list of tuples (y), (x, y), ... )
def isPointInPath(x, y, poly):
num = len(poly)
i = 0
j = num - 1
c = False
for i in range(num):
if ((poly()() > y) != (poly()() > y)) and \
(x < (poly()() - poly()())
* (y - poly()()) / (poly()() - poly()()) + poly()()):
c = not c
j = i
return c


抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Even–odd rule」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.